package cn.itsource.user.service.impl;

import cn.itsource.basic.service.impl.BaseServiceImpl;
import cn.itsource.basic.util.AjaxResult;
import cn.itsource.user.domain.User;
import cn.itsource.user.mapper.UserMapper;
import cn.itsource.user.service.IUserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Random;

@Service
public class UserServiceImpl extends BaseServiceImpl<User> implements IUserService{
    @Autowired
    private UserMapper mapper;
    @Override
    public void finduserbypassword(String tel) throws Exception {
        if(StringUtils.isEmpty(tel)){
            throw new Exception("手机不能为空");
        }
        User user = mapper.finduserbypassword(tel);
        if(user != null){
            throw new Exception("用户已经存在");
        }
    }


}
